<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('区域管理')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<style>
    .bootstrap-tree-table .treetable-tbody td {
        white-space: normal !important;
    }

    .select-table {
        overflow: scroll;
        height: 89% !important;
        padding: 10px !important;

    }

    select {
        padding-top: 3px !important;
    }

    .select-list {
        margin-top: 5px !important;
    }

    .treetable-expander {
        width: auto !important;
        height: auto !important;
    }

    .bootstrap-tree-table .treetable-bars .tool-right {
        float: left !important;
        left: 10px;
    }

    .table-striped .table > thead:first-child > tr:first-child > th {
        font-weight: normal;
        font-size: 13px;
        border: 1px solid #cccccc !important;
    }

    .bootstrap-tree-table .treetable-tbody td {
        border: 1px solid #cccccc !important;
        border-top: 0px solid #cccccc !important;
    }

    .select-list li p {
        width: 20px !important;
    }

</style>
<body class="gray-bg">

<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" id="add"
                   onclick="closeItem()">
                    <i class="fa fa-back"></i> 返回上一级
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">

    /* 获取服务端返回变量 */
    var companyId = [[${companyId}]];
    var programId = [[${programId}]];
    var identification = [[${identification}]];

    /* 服务端模块url */
    var prefix = ctx + "concreteManage";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 300});

        queryConcreteDetailList();

        formatDate();
    });

    /* 初始化列表 */
    function queryConcreteDetailList(){
        var options = {
            url: prefix + "/detailListData?companyId="+companyId+"&programId="+programId+"&identification=" + identification,
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            importUrl: prefix + "/importData",
            importTemplateUrl: prefix + "/importTemplate",
            modalName: "混凝土报表",
            columns: [
                {
                    field: 'buildingNumber',
                    align: 'center',
                    title: '工程部位'
                },
                {
                    field: 'floorNumber',
                    align: 'center',
                    title: '结构部位',
                    sortable: true
                },
                {
                    field: 'pouringTime',
                    align: 'center',
                    title: '浇筑日期'
                },
                {
                    field: 'designLabel',
                    align: 'center',
                    title: '设计标号(Mpa)'
                },
                {
                    field: 'age',
                    align: 'center',
                    title: '龄期'
                },
                {
                    field: 'averIntensity',
                    align: 'center',
                    title: '强度平均(Mpa)'
                },
                {
                    field: 'minIntensity',
                    align: 'center',
                    title: '强度最小(Mpa)'
                },
                {
                    field: 'note',
                    align: 'center',
                    title: '碳化深度'
                }
                ]
        };
        $.table.init(options);
    }

</script>
</body>
</html>